package com.jml.zlhq.app.ui;

import java.util.Map;
import com.jml.zlhq.app.R;
import com.jml.zlhq.app.util.StringUtil;
import com.jml.zlhq.app.util.UIUtil;

import android.os.Bundle;
import android.view.View;
import android.widget.AutoCompleteTextView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class SurgestActivity extends BaseActivity {
	private EditText input;
	private TextView msg;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.surgest_activity);
		
		LinearLayout leftLay = (LinearLayout) findViewById(R.id.content_header_left_lay);
		LinearLayout rightLay = (LinearLayout) findViewById(R.id.content_header_right_lay);
		leftLay.setOnClickListener(this);
		rightLay.setOnClickListener(this);
		AutoCompleteTextView centerEdit = (AutoCompleteTextView) findViewById(R.id.content_header_center_edit);
		centerEdit.setVisibility(View.GONE);
		ImageView leftImage = (ImageView) findViewById(R.id.content_header_left_img);
		leftImage.setImageResource(R.drawable.back_selector);
		ImageView roghtImage1 = (ImageView) findViewById(R.id.content_header_right_img);
		roghtImage1.setVisibility(View.GONE);
		TextView centerText = (TextView) findViewById(R.id.content_header_center_text);
		centerText.setText("意见反馈");
		TextView rightText = (TextView) findViewById(R.id.content_header_right_text);
		rightText.setText("发送");
		TextView cityChosed = (TextView) findViewById(R.id.content_header_center_text2);
		cityChosed.setVisibility(View.GONE);
		
		input = (EditText) findViewById(R.id.surgest_input);
		msg = (TextView) findViewById(R.id.surgest_msg);
	}

	@Override
	public void loadData(Map<String, String> param) {}

	@Override
	public void clearData() {}

	@Override
	public void onClick(View view) {
		switch (view.getId()) {
		case R.id.content_header_left_lay:
			finish();
			break;
		case R.id.content_header_right_lay:
			if(StringUtil.isEmpty(input.getText().toString())){
				msg.setText("您什么都还没有输入");
			}else{
				UIUtil.ToastMessage(activity, "谢谢您的宝贵意见");
				finish();
			}
			break;
		default:
			break;
		}
	}

}
